package com.buddha.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2023-07-06
 */
@Data
  @TableName("user")
@ApiModel(value = "User对象", description = "")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

      @ApiModelProperty("id")
        @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      @ApiModelProperty("头像")
      private String avatar;

      @NotBlank(message = "邮箱不能为空")
      @Email(message = "邮箱格式不正确")
      @ApiModelProperty("邮箱")
      private String email;

      @ApiModelProperty("上次登录时间")
      private LocalDateTime lastLogin;

      @ApiModelProperty("用户名（账号）")
      @NotBlank(message = "用户名不能为空")
      private String username;

      @ApiModelProperty("密码")
      private String password;

      @ApiModelProperty("创建时间")
      private LocalDateTime created;

      @ApiModelProperty("上次更新时间")
      private LocalDateTime updated;

      @ApiModelProperty("状态：1（正常），0（禁用）")
      private Integer state;

      @ApiModelProperty("手机号")
      private String phone;

      @TableField(exist = false)
      private List<Role> roles;
}
